extends "../banglebase/banglebase.gd"
var huolist = ["b_shaoZhuo","b_zs","b_hq","hzrs"]
var cnt 
var cnt2
var cnt3
func init():
	.init()
	name = "火手镯"
	resetdata()
	att.atk = 15
	att.cri = 0.1
	info = "火种入侵：所有攻击[特效伤害除外]附带<火种>\n[装备每次只能附加一个对象，只有当对象身上没有本装备添加的火种才可以切换对象附加，可以和别的装备附加同一个对象]"

func _connect():
	._connect()
	masCha.connect("onAtkChara",self,"adddu")
	masCha.connect("onBattleStart",self,"resetcnt")

func resetcnt():
	cnt = 0
	cnt2 = 0
	cnt3 = 0

func adddu(atkinfo):
	if atkinfo.hitCha !=target && target != null:return
	if atkinfo.isMiss || atkinfo.atkType == Chara.AtkType.EFF:return
	var bf = atkinfo.hitCha.hasBuff("b_huozhong")
	var lf = 3
	if masCha.hasBuff("HY"):lf = 6
	var exdmg = 0
	if self.id.find("25") != -1:exdmg = masCha.att.atk * 0.1
	if !bf:
		var flag = 0
		for i in huolist:
			var bf2 = atkinfo.hitCha.hasBuff(i)
			if bf2:
				bf2.isDel = true
				flag = 1
		if flag:
			masCha.hurtChara(atkinfo.hitCha,atkinfo.hitCha.att.maxHp * 0.05 + exdmg,Chara.HurtType.REAL,Chara.AtkType.EFF)
			return
		target = atkinfo.hitCha
		atkinfo.hitCha.addBuff(ctrl.b_huozhong.new(lf,1,exdmg,self))
	else:
		bf.life += lf
		bf.cnt += 1

class MYH:
	extends Buff
	var canremove:bool = false
	var binglist = ["b_shaoZhuo","b_zs","b_hq","hzrs"]
	func _init(lv):
		attInit()
		life = lv * 4

	func _connect():
		masCha.connect("onAddBuff",self,"run")

	func run(buff):
		if binglist.find(buff.id) != -1:
			buff.isDel = true